package org.apache.derby.shared.common.info;

/**
 * @author ex_chenzy59
 * @since 2025/3/13
 *
 */
public abstract class JVMInfo {
    private static final boolean _isModuleAware;
    public static final int J2SE_18 = 9;   // Java SE 8
    public static final int JDK_ID;
    static{
        // If the property java.specification.version is set, then try to parse
        // that.  Anything we don't recognize, default to Java 2 platform
        // because java.specification.version is a property that is introduced
        // in Java 2.  We hope that JVM vendors don't implement Java 1 and
        // set a Java 2 system property.
        //
        // Otherwise, see if we recognize what is set in java.version.
        // If we don't recognize that, or if the property is not set, assume
        // version 1.8, which is the lowest level we support.
        JDK_ID = J2SE_18;
        _isModuleAware = (getSystemModulePath() != null);
    }
    public static final String getSystemModulePath(){
        return getSystemProperty("jdk.module.path");
    }
    private static String getSystemProperty(final String name) {
        return System.getProperty(name);
    }
    public static final boolean isModuleAware()
    {
        return _isModuleAware;
    }
}
